package com.hrt.util;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;

public interface ISuperDao<T> {

	public abstract void setSessionFactoryOverride(SessionFactory sessionFactory);

	public abstract List<T> queryByPage(Class<T> clz, int pageIndex,int pageSize);

	public abstract <T> T queryById(T clz, Long  id) throws Exception;

	/**
	 * ����/���·���
	 * @param object
	 * @throws Exception
	 */
	public abstract void save(Object object) throws Exception;

	/**
	 * 
	 * @param cls
	 * @param id
	 * @throws Exception
	 */
	public abstract <T> void deleteById(Class<T> cls, Long id) throws Exception;
	
	/**
	 * 
	 * @param clz
	 * @param ids
	 */
	public abstract <T>  void deleteByIds(Class clz, Long[] ids);

	public abstract SessionFactory getHibernateSessionFactory()
			throws Exception;

}